﻿namespace ltModel.Model
{
    #region userTeam.Model
    /// <summary>
    /// 实体类userTeam
    /// </summary>
    public class userTeam
    {
        public userTeam()
        { }
        #region Model
        private int _user_id;
        private string _sh;
        private string _tj;
        private string _add;
        private string _del;
        private string _lmqx;
        private string _funcqx;
        private string _info;
        /// <summary>
        /// 用户id
        /// </summary>
        public int user_id
        {
            set { _user_id = value; }
            get { return _user_id; }
        }
        /// <summary>
        /// 审核权限
        /// </summary>
        public string sh
        {
            set { _sh = value; }
            get { return _sh; }
        }
        /// <summary>
        /// 推荐权限
        /// </summary>
        public string tj
        {
            set { _tj = value; }
            get { return _tj; }
        }
        /// <summary>
        /// 添加权限
        /// </summary>
        public string add
        {
            set { _add = value; }
            get { return _add; }
        }
        /// <summary>
        /// 删除权限
        /// </summary>
        public string del
        {
            set { _del = value; }
            get { return _del; }
        }
        /// <summary>
        /// 栏目权限
        /// </summary>
        public string lmqx
        {
            set { _lmqx = value; }
            get { return _lmqx; }
        }
        /// <summary>
        /// 发布权限
        /// </summary>
        public string funcqx
        {
            set { _funcqx = value; }
            get { return _funcqx; }
        }
        /// <summary>
        /// 简介
        /// </summary>
        public string info
        {
            set { _info = value; }
            get { return _info; }
        }
        #endregion Model

        public bool HasSh
        {
            get
            {
                return ToBool(sh);
            }
        }

        public bool HasTj
        {
            get
            {
                return ToBool(tj);
            }
        }

        public bool HasAdd
        {
            get { return ToBool(add); }
        }

        public bool HasDel
        {
            get { return ToBool(del); }
        }

        public string GetFunQx()
        {
            if (string.IsNullOrEmpty(funcqx))
                return "0";
            return funcqx;
        }

        public string GetLmQx()
        {
            if (string.IsNullOrEmpty(lmqx))
                return "0";
            return lmqx;
        }

        private bool ToBool(string s)
        {
            if (Str.IsInt(s))
                return int.Parse(s) == 1;
            return System.Convert.ToBoolean(s);
        }
    }
    #endregion
}